package com.sky.mapper;

import com.sky.annotation.DelRedisDish;
import com.sky.entity.DishFlavor;
import com.sky.enumeration.RedisCategoryType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface DishFlavorsMapper {
    @DelRedisDish(value = RedisCategoryType.DISH)
    void insertBatch(List<DishFlavor> dishFlavor);
    @DelRedisDish(value = RedisCategoryType.DISH)
    void deleteBatchByDishId(List<Long> ids);
    @DelRedisDish(value = RedisCategoryType.DISH)
    @Delete("delete from dish_flavor where dish_id = #{id}")
    void deleteByDishId(Long id);

    List<DishFlavor> getFlavorsByDishId(Long dishId);
}
